// run: $exec < b-small.in > b-small.out
#include <iostream>
#include <algorithm>
#include <vector>
#include <iomanip>

int const maxn = 300;
double p[maxn];
double dp[maxn][maxn][maxn];
int n, k;
std::vector<double> v;

double calc()
{
	double dp[maxn][maxn] = {};
	for (int i = 0; i < (int)v.size(); i ++) {
		if (i == 0) {
			dp[i][1] = v[i];
			dp[i][0] = 1.0 - v[i];
		} else {
			for (int j = 0; j <= i; j ++) {
				dp[i][j + 1] += dp[i - 1][j] * v[i];
				dp[i][j] += dp[i - 1][j] * (1.0 - v[i]);
			}
		}
	}
	return dp[v.size() - 1][k / 2];
}

int main()
{
	int T; std::cin >> T;
	for (int ti = 1; ti <= T; ti++) {
		std::cout << "Case #" << ti << ": ";
		std::cin >> n >> k;
		for (int i = 1; i <= n; i++)
			std::cin >> p[i];
		double ans = 0.0;
		for (int i = 0; i < (1 << n); i ++) {
			int cnt = 0;
			for (int j = 0; j < n; j ++)
				if (i & (1 << j)) cnt ++;
			if (cnt == k) {
				v.clear();
				for (int j = 0; j < n; j ++) {
					if (i & (1 << j)) {
						v.push_back(p[j + 1]);
					}
				}
				ans = std::max(ans, calc());
			}
		}
		std::cout << std::fixed << std::setprecision(8) << ans << '\n';
	}
}

